<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- InstanceBegin template="/Templates/hpp_c1_c2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<%@ include file="/common/meta.jsp"%>
<title>VTC - Holistic Programme Planning - HPP</title>
<%@ include file="/common/css_js.jsp"%>

<script type="text/javascript">
	var iframeResize = function(){
		var targObj = self;
		//1.  取得iframe的对象
		var targWin = targObj.parent.document.getElementById("programmeIframe");
		//2.  取得本页面的显示数据对象
		var projectionTypeTable = document.getElementById("offeringCampusDiv");
		
		if(targWin != null) {
		
			//3, 下面是取数据表格高度,
			// 也可取本htm文档的高度 ： var HeightValue = targObj.document.body.scrollHeight
			var HeightValue = projectionTypeTable.scrollHeight+20;
			targWin.style.height = HeightValue + "px";
		}
		
	}

	$(document).ready(function() {
		iframeResize();
		$("#offeringCampusForm").validate();
	});

	
	
	function clickBtn(action,e,id){
		switch(action){
		case "add":
			  parent.popup(e, 'programme-leader!input.action?no-decorate&programmeId='+$("#programmeId").val(), 'width:500;height:260');
			  return;
			  
		case "delete":
			  $("#programmeLeaderForm").attr("action", "programme-leader!delete.action?no-decorate");
			  break;
			  
		case "edit":
			parent.popup(e, 'programme-leader!input.action?no-decorate&programmeLeader.id='+id+'&programmeId='+$("#programmeId").val(), 'width:500;height:260');
			return;			  
		}
		
		$("#programmeLeaderForm").submit();
	}
	
</script>

</head>
<body style="background-color: transparent;">
	<s:form name="programmeLeaderForm" id="programmeLeaderForm"
		action="programme-leader!delete.action?no-decorate" method="post">
		<s:hidden name="programmeId" id="programmeId"></s:hidden>

		<div class="sListBorder" id="offeringCampusDiv">
			<div class="sList">

				<table cellspacing="0" cellpadding="0" border="0" width="100%"
					class="sTable">
					<tbody>
						<tr>
							<td class="sTh checkbox"><input type="checkbox" name=""
								id="controlCheckbox" class="inputCheckbox"
								onclick="clickParent('controlCheckbox','ids')" />
							</td>
							<td class="sTh">Chinese Name</td>
							<td class="sTh">English Name</td>
							<td class="sTh">Email</td>
							<td class="sTh">Is Leader</td>
							<td class="sTh">Action</td>
						</tr>

						<s:if test="%{results!=null&&results.size()!=0}">
							<s:iterator value="results" var="programmeLeader" status="st">

								<s:set var="trClass" value="'sRow1'"></s:set>
								<s:if test="#st.index%2==0">
									<s:set var="trClass" value="'sRow2'"></s:set>
									<s:else>
										<s:set var="trClass" value="'sRow1'"></s:set>
									</s:else>
								</s:if>

								<tr class="<s:property value="#trClass"/>">
									<td class="sCell"><input type="checkbox" name="ids"
										value="<s:property value='#programmeLeader.id'/>"
										onclick="clickChild('controlCheckbox','ids')"
										class="inputCheckbox" /></td>
									<td class="sCell"><s:property
											value="#programmeLeader.chineseName" />
									</td>
									<td class="sCell"><s:property
											value="#programmeLeader.englishName" />
									</td>
									<td class="sCell"><s:property
											value="#programmeLeader.email" />
									</td>
									<td class="sCell"><s:if test="#programmeLeader.leader">Yes</s:if>
										<s:else>No</s:else>
									</td>
									<td class="sCell buttonCell"><div class="button sbtn">
											<div class="left">
												<div class="right">
													<input type="button"
														onclick="clickBtn('edit',event,'<s:property value='#programmeLeader.id'/>')"
														value="Edit" name="" id="" class="inputButton" />
												</div>
											</div>
										</div></td>
								</tr>

							</s:iterator>
						</s:if>
					</tbody>
				</table>
			</div>

			<div class="btnSet btnSetTypeA">
				<div class="left">
					<s:if test="canEdit">
						<div class="button">
							<div class="left">
								<div class="right">
									<input type="button" onclick="clickBtn('add',event)"
										value="Add" name="" id="" class="inputButton">
								</div>
							</div>
						</div>
						<div class="button">
							<div class="left">
								<div class="right">
									<input type="button" onclick="clickBtn('delete',event)"
										value="Delete" name="" id="" class="inputButton">
								</div>
							</div>
						</div>
					</s:if>
				</div>
			</div>



		</div>
	</s:form>

</body>
</html>
